﻿<Window x:Class="SgfEd.NewGameDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="New Game"
    Height="250"
    Width="300"
    MinHeight="10"
    MinWidth="300"
    ResizeMode="CanResizeWithGrip"
    ShowInTaskbar="False"
    WindowStartupLocation="CenterOwner" 
    FocusManager.FocusedElement="{Binding ElementName=whiteText}">

    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type Grid}">
                <Setter Property="Margin" Value="10" />
            </Style>
            <Style TargetType="{x:Type Label}">
                <Setter Property="Margin" Value="0,3,5,5" />
                <Setter Property="Padding" Value="0,0,0,5" />
            </Style>
            <!--
      <Style TargetType="{x:Type TextBox}">
        <Setter Property="Margin" Value="0,0,0,5" />
        <Style.Triggers>
          <Trigger Property="Validation.HasError" Value="true">
            <Setter Property="ToolTip" 
                    Value="{Binding RelativeSource={RelativeSource Self},
                                    Path=(Validation.Errors)[0].ErrorContent}"/>
          </Trigger>
        </Style.Triggers>
      </Style>
      -->
            <Style TargetType="{x:Type StackPanel}">
                <Setter Property="Orientation" Value="Horizontal" />
                <Setter Property="HorizontalAlignment" Value="Right" />
            </Style>
            <Style TargetType="{x:Type Button}">
                <Setter Property="Width" Value="70" />
                <Setter Property="Height" Value="25" />
                <Setter Property="Margin" Value="5,0,0,0" />
            </Style>
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <!-- White -->
        <Label Grid.Column="0" Grid.Row="0">White:</Label>
        <TextBox Name="whiteText" Grid.Column="1" Grid.Row="0">
        </TextBox>

        <!-- Black -->
        <Label Grid.Column="0" Grid.Row="1">Black:</Label>
        <TextBox Name="blackText" Grid.Column="1" Grid.Row="1">
        </TextBox>

        <!-- Size -->
        <Label Grid.Column="0" Grid.Row="2">Size:</Label>
        <TextBox Name="sizeText" Grid.Column="1" Grid.Row="2">
        </TextBox>

        <!-- Handicap -->
        <Label Grid.Column="0" Grid.Row="3">Handicap:</Label>
        <TextBox Name="handicapText" Grid.Column="1" Grid.Row="3">
        </TextBox>

        <!-- Komi -->
        <Label Grid.Column="0" Grid.Row="4">Komi:</Label>
        <TextBox Name="komiText" Grid.Column="1" Grid.Row="4">
        </TextBox>

        <!-- OK or Cancel -->
        <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" Margin="0,15">
            <Button Name="okButton" Click="okButton_click" IsDefault="True">OK</Button>
            <Button Name="cancelButton" IsCancel="True">Cancel</Button>
        </StackPanel>

    </Grid >

</Window>
